package com.nchu.mappers;

import com.nchu.pojo.Filter;
import com.nchu.pojo.OrderComplain;
import com.nchu.pojo.OrderForm;
//import com.sun.org.apache.xpath.internal.operations.Or;
import com.nchu.pojo.User;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {

    //根据用户id查找自己发布的订单
    List<OrderForm> FindAllbyid(int userid);


    //根据用户id查找自己接取的订单Find and pick up orders
    List<OrderForm> FindPickUpOrdersByid(int userid);



    //根据用户id和状态查找订单
    List<OrderForm> FindAllbyidandstatus(int userid,int status);


    //根据用户id和状态查找订单(用于查接单)
    List<OrderForm> FindAllbyreceiveUserandstatus(int userid,int status);

    //根据订单号查找订单
    OrderForm FindByOrderid(int orderid);

    void InsertOrderReceivingUserAndChangeOrderStatus(int orderId, int userId);

    //增加订单
    public int addOrder(OrderForm orderForm);

    //该方法用于投诉人查看自己举报了多少条
    List<OrderComplain> Qurry(int complainantid);


    //该方法用于被投诉人查看自己被举报了多少条
    List<OrderComplain> Find(int respondentid);


    //增加一条投诉记录
    int AddComplain(int orderid,int complainantid,int respondentid,String complain);

    //修改一条投诉记录
    int changebyid(int orderid,String remark);


    //删除一条投诉记录根据id(逻辑删除)
    int deletebyid(int orderid);

    List<OrderForm> queryAllOrders();

    List<OrderForm> queryOrderFormsByLimit(Filter filter);

    //通过订单号查询投诉记录
    List<OrderComplain> queryByOrderId(int orderid);

    //删除订单通过订单号（逻辑删除）
    int deletebyorderid(int orderid);

    //完成订单操作
    int finishorder(int orderid);

    OrderForm findone(int orderid);

    //接单员弹窗
//    User popup(int userid);
    int updataOrderTransationstatus(int orderid);


    //投诉订单修改状态为处理中
    int updatacomplainstatus(int orderid);


    int OrderSettlement(OrderForm orderForm);

}
